import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'

// import './assets/main.css'

const app = createApp(App)

app.use(createPinia())
app.use(router)
const whiteList = ['/']
router.beforeEach((to,from,next)=>{
    if(whiteList.includes(to.path) || localStorage.getItem('token')){
        if(to.meta.title){
            // console.log(to.meta.title);   
            document.title = to.meta.title
        }
        next()
    }else{
        next('/')
    }
})
// router.afterEach((to,from)=>{

// })

app.mount('#app')
